<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/>
<meta http-equiv="X-UA-Compatible" content="IE=9"/>
<meta name="generator" content="Doxygen 1.8.13"/>
<meta name="viewport" content="width=device-width, initial-scale=1"/>
<title>General</title>
<link href="tabs.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="jquery.js"></script>
<script type="text/javascript" src="dynsections.js"></script>
<link href="navtree.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="resize.js"></script>
<script type="text/javascript" src="navtreedata.js"></script>
<script type="text/javascript" src="navtree.js"></script>
<script type="text/javascript">
  $(document).ready(initResizable);
</script>
<link href="search/search.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="search/searchdata.js"></script>
<script type="text/javascript" src="search/search.js"></script>
<link href="doxygen.css" rel="stylesheet" type="text/css" />
</head>
<body>
<div id="top"><!-- do not remove this div, it is closed by doxygen! -->
<div id="titlearea">
<table cellspacing="0" cellpadding="0">
 <tbody>
 <tr style="height: 56px;">
  <td id="projectlogo"><img alt="Logo" src="kvaser.gif"/></td>
 </tr>
 </tbody>
</table>
</div>
<!-- end header part -->
<!-- Generated by Doxygen 1.8.13 -->
<script type="text/javascript">
var searchBox = new SearchBox("searchBox", "search",false,'Search');
</script>
<script type="text/javascript" src="menudata.js"></script>
<script type="text/javascript" src="menu.js"></script>
<script type="text/javascript">
$(function() {
  initMenu('',true,false,'search.php','Search');
  $(document).ready(function() { init_search(); });
});
</script>
<div id="main-nav"></div>
</div><!-- top -->
<div id="side-nav" class="ui-resizable side-nav-resizable">
  <div id="nav-tree">
    <div id="nav-tree-contents">
      <div id="nav-sync" class="sync"></div>
    </div>
  </div>
  <div id="splitbar" style="-moz-user-select:none;" 
       class="ui-resizable-handle">
  </div>
</div>
<script type="text/javascript">
$(document).ready(function(){initNavTree('group__lin__general.html','');});
</script>
<div id="doc-content">
<!-- window showing the filter options -->
<div id="MSearchSelectWindow"
     onmouseover="return searchBox.OnSearchSelectShow()"
     onmouseout="return searchBox.OnSearchSelectHide()"
     onkeydown="return searchBox.OnSearchSelectKey(event)">
</div>

<!-- iframe showing the search results (closed by default) -->
<div id="MSearchResultsWindow">
<iframe src="javascript:void(0)" frameborder="0" 
        name="MSearchResults" id="MSearchResults">
</iframe>
</div>

<div class="header">
  <div class="summary">
<a href="#func-members">Functions</a>  </div>
  <div class="headertitle">
<div class="title">General<div class="ingroups"><a class="el" href="group__grp__linlib.html">LINlib</a></div></div>  </div>
</div><!--header-->
<div class="contents">

<p>Initialization, reading versions and other information.  
<a href="#details">More...</a></p>
<table class="memberdecls">
<tr class="heading"><td colspan="2"><h2 class="groupheader"><a name="func-members"></a>
Functions</h2></td></tr>
<tr class="memitem:gaf47a1f1078f6b3919e2b2d9dfd559d8b"><td class="memItemLeft" align="right" valign="top">void&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="group__lin__general.html#gaf47a1f1078f6b3919e2b2d9dfd559d8b">linInitializeLibrary</a> (void)</td></tr>
<tr class="separator:gaf47a1f1078f6b3919e2b2d9dfd559d8b"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:ga3b6bd0017ef68891ac1843a5921f81da"><td class="memItemLeft" align="right" valign="top">void&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="group__lin__general.html#ga3b6bd0017ef68891ac1843a5921f81da">linUnloadLibrary</a> (void)</td></tr>
<tr class="separator:ga3b6bd0017ef68891ac1843a5921f81da"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:ga6a182f2608e54e273f80f27770afa9dc"><td class="memItemLeft" align="right" valign="top"><a class="el" href="group__lin__status__codes.html#ga7a5ecfd2846ddd76cd49fb4edec7fc14">LinStatus</a>&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="group__lin__general.html#ga6a182f2608e54e273f80f27770afa9dc">linGetVersion</a> (int *major, int *minor, int *build)</td></tr>
<tr class="separator:ga6a182f2608e54e273f80f27770afa9dc"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:gafa260028be850e70a99c1b0706679583"><td class="memItemLeft" align="right" valign="top"><a class="el" href="group__lin__status__codes.html#ga7a5ecfd2846ddd76cd49fb4edec7fc14">LinStatus</a>&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="group__lin__general.html#gafa260028be850e70a99c1b0706679583">linGetFirmwareVersion</a> (<a class="el" href="linlib_8h.html#a759b2696d97bd97008d8df007d9ac44a">LinHandle</a> h, unsigned char *bootVerMajor, unsigned char *bootVerMinor, unsigned char *bootVerBuild, unsigned char *appVerMajor, unsigned char *appVerMinor, unsigned char *appVerBuild)</td></tr>
<tr class="separator:gafa260028be850e70a99c1b0706679583"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:gac5c5dadc7ca9d70c627058a9b2b06231"><td class="memItemLeft" align="right" valign="top"><a class="el" href="group__lin__status__codes.html#ga7a5ecfd2846ddd76cd49fb4edec7fc14">LinStatus</a>&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="group__lin__general.html#gac5c5dadc7ca9d70c627058a9b2b06231">linGetChannelData</a> (int channel, int item, void *buffer, size_t bufsize)</td></tr>
<tr class="separator:gac5c5dadc7ca9d70c627058a9b2b06231"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:ga8af35ecbb1aca56baed27990f3d43d4b"><td class="memItemLeft" align="right" valign="top">unsigned long&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="group__lin__general.html#ga8af35ecbb1aca56baed27990f3d43d4b">linReadTimer</a> (<a class="el" href="linlib_8h.html#a759b2696d97bd97008d8df007d9ac44a">LinHandle</a> h)</td></tr>
<tr class="separator:ga8af35ecbb1aca56baed27990f3d43d4b"><td class="memSeparator" colspan="2">&#160;</td></tr>
</table>
<a name="details" id="details"></a><h2 class="groupheader">Detailed Description</h2>
<p>Initialization, reading versions and other information. </p>
<h2 class="groupheader">Function Documentation</h2>
<a id="gac5c5dadc7ca9d70c627058a9b2b06231"></a>
<h2 class="memtitle"><span class="permalink"><a href="#gac5c5dadc7ca9d70c627058a9b2b06231">&#9670;&nbsp;</a></span>linGetChannelData()</h2>

<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname"><a class="el" href="group__lin__status__codes.html#ga7a5ecfd2846ddd76cd49fb4edec7fc14">LinStatus</a> linGetChannelData </td>
          <td>(</td>
          <td class="paramtype">int&#160;</td>
          <td class="paramname"><em>channel</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">int&#160;</td>
          <td class="paramname"><em>item</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">void *&#160;</td>
          <td class="paramname"><em>buffer</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">size_t&#160;</td>
          <td class="paramname"><em>bufsize</em>&#160;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td></td>
        </tr>
      </table>
</div><div class="memdoc">
<p>This function can be used to retrieve certain pieces of information about a channel.</p>
<dl class="section note"><dt>Note</dt><dd>You must pass a channel number and not a channel handle.</dd></dl>
<dl class="params"><dt>Parameters</dt><dd>
  <table class="params">
    <tr><td class="paramdir">[in]</td><td class="paramname">channel</td><td>The number of the channel you are interested in. Channel numbers are integers in the interval beginning at 0 </td></tr>
    <tr><td class="paramdir">[in]</td><td class="paramname">item</td><td>This parameter specifies what data to obtain for the specified channel. The value is one of the constants <a class="el" href="linlib_8h.html#linCHANNELDATA_xxx">linCHANNELDATA_xxx</a>. </td></tr>
    <tr><td class="paramdir">[out]</td><td class="paramname">buffer</td><td>The address of a buffer which is to receive the data. </td></tr>
    <tr><td class="paramdir">[in]</td><td class="paramname">bufsize</td><td>The size of the buffer to which the buffer parameter points.</td></tr>
  </table>
  </dd>
</dl>
<dl class="section return"><dt>Returns</dt><dd><a class="el" href="group__lin__status__codes.html#gga7a5ecfd2846ddd76cd49fb4edec7fc14a548e5df5738051c1e7ab0a3dcb8aa7b1">linOK</a> (zero) if success </dd>
<dd>
<a class="el" href="group__lin__status__codes.html#linERR_xxx">linERR_xxx</a> (negative) if failure </dd></dl>

</div>
</div>
<a id="gafa260028be850e70a99c1b0706679583"></a>
<h2 class="memtitle"><span class="permalink"><a href="#gafa260028be850e70a99c1b0706679583">&#9670;&nbsp;</a></span>linGetFirmwareVersion()</h2>

<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname"><a class="el" href="group__lin__status__codes.html#ga7a5ecfd2846ddd76cd49fb4edec7fc14">LinStatus</a> linGetFirmwareVersion </td>
          <td>(</td>
          <td class="paramtype"><a class="el" href="linlib_8h.html#a759b2696d97bd97008d8df007d9ac44a">LinHandle</a>&#160;</td>
          <td class="paramname"><em>h</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">unsigned char *&#160;</td>
          <td class="paramname"><em>bootVerMajor</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">unsigned char *&#160;</td>
          <td class="paramname"><em>bootVerMinor</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">unsigned char *&#160;</td>
          <td class="paramname"><em>bootVerBuild</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">unsigned char *&#160;</td>
          <td class="paramname"><em>appVerMajor</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">unsigned char *&#160;</td>
          <td class="paramname"><em>appVerMinor</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">unsigned char *&#160;</td>
          <td class="paramname"><em>appVerBuild</em>&#160;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td></td>
        </tr>
      </table>
</div><div class="memdoc">
<p>This function retrieves the firmware version from the LIN interface.</p>
<dl class="section note"><dt>Note</dt><dd>For newer interfaces a call to this function will return <a class="el" href="group__lin__status__codes.html#gga7a5ecfd2846ddd76cd49fb4edec7fc14a9dba946875481393e81a7498ab15bd44">linERR_NOT_IMPLEMENTED</a>.<br />
 Use <a class="el" href="group__lin__general.html#gac5c5dadc7ca9d70c627058a9b2b06231">linGetChannelData()</a> with <a class="el" href="linlib_8h.html#a1478f1730f3209a2b95bf366035e46ce">linCHANNELDATA_CARD_FIRMWARE_REV</a> instead.</dd>
<dd>
The version numbers aren't valid until <a class="el" href="group___l_i_n.html#ga79ab73655c1749ad9fe2b784885e2dd9">linBusOn()</a> has been called.</dd>
<dd>
The firmware in the LIN interface is divided into two parts, the boot code and the application. The boot code is used only when reprogramming (reflashing) the LIN interface. The application handles all LIN communication.</dd>
<dd>
Version numbers are, since the precambric era, divided into a major version number, a minor version number and a build number. These are usually written like, for example, 3.2.12. Here the major number is 3, the minor number 2 and the build number 12.</dd></dl>
<dl class="params"><dt>Parameters</dt><dd>
  <table class="params">
    <tr><td class="paramdir">[in]</td><td class="paramname">h</td><td>A handle to an open LIN channel. </td></tr>
    <tr><td class="paramdir">[out]</td><td class="paramname">bootVerMajor</td><td>A pointer to a byte where the major version number of the boot code is stored. </td></tr>
    <tr><td class="paramdir">[out]</td><td class="paramname">bootVerMinor</td><td>A pointer to a byte where the minor version number of the boot code is stored. </td></tr>
    <tr><td class="paramdir">[out]</td><td class="paramname">bootVerBuild</td><td>A pointer to a byte where the build number of the boot code is stored. </td></tr>
    <tr><td class="paramdir">[out]</td><td class="paramname">appVerMajor</td><td>A pointer to a byte where the major version number of the application code is stored. </td></tr>
    <tr><td class="paramdir">[out]</td><td class="paramname">appVerMinor</td><td>A pointer to a byte where the minor version number of the application code is stored. </td></tr>
    <tr><td class="paramdir">[out]</td><td class="paramname">appVerBuild</td><td>A pointer to a byte where the build number of the application is stored.</td></tr>
  </table>
  </dd>
</dl>
<dl class="section return"><dt>Returns</dt><dd><a class="el" href="group__lin__status__codes.html#gga7a5ecfd2846ddd76cd49fb4edec7fc14a548e5df5738051c1e7ab0a3dcb8aa7b1">linOK</a> (zero) if success </dd>
<dd>
<a class="el" href="group__lin__status__codes.html#linERR_xxx">linERR_xxx</a> (negative) if failure </dd></dl>

</div>
</div>
<a id="ga6a182f2608e54e273f80f27770afa9dc"></a>
<h2 class="memtitle"><span class="permalink"><a href="#ga6a182f2608e54e273f80f27770afa9dc">&#9670;&nbsp;</a></span>linGetVersion()</h2>

<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname"><a class="el" href="group__lin__status__codes.html#ga7a5ecfd2846ddd76cd49fb4edec7fc14">LinStatus</a> linGetVersion </td>
          <td>(</td>
          <td class="paramtype">int *&#160;</td>
          <td class="paramname"><em>major</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">int *&#160;</td>
          <td class="paramname"><em>minor</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">int *&#160;</td>
          <td class="paramname"><em>build</em>&#160;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td></td>
        </tr>
      </table>
</div><div class="memdoc">
<p>This function retrieves the LIBLIB library version.</p>
<dl class="params"><dt>Parameters</dt><dd>
  <table class="params">
    <tr><td class="paramdir">[out]</td><td class="paramname">major</td><td>A pointer to an int where the major version number of the library is stored. </td></tr>
    <tr><td class="paramdir">[out]</td><td class="paramname">minor</td><td>A pointer to an int where the minor version number of the library is stored. </td></tr>
    <tr><td class="paramdir">[out]</td><td class="paramname">build</td><td>A pointer to an int where the bulid number of the library is stored.</td></tr>
  </table>
  </dd>
</dl>
<dl class="section return"><dt>Returns</dt><dd><a class="el" href="group__lin__status__codes.html#gga7a5ecfd2846ddd76cd49fb4edec7fc14a548e5df5738051c1e7ab0a3dcb8aa7b1">linOK</a> (zero) if success </dd>
<dd>
<a class="el" href="group__lin__status__codes.html#linERR_xxx">linERR_xxx</a> (negative) if failure </dd></dl>

</div>
</div>
<a id="gaf47a1f1078f6b3919e2b2d9dfd559d8b"></a>
<h2 class="memtitle"><span class="permalink"><a href="#gaf47a1f1078f6b3919e2b2d9dfd559d8b">&#9670;&nbsp;</a></span>linInitializeLibrary()</h2>

<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">void linInitializeLibrary </td>
          <td>(</td>
          <td class="paramtype">void&#160;</td>
          <td class="paramname"></td><td>)</td>
          <td></td>
        </tr>
      </table>
</div><div class="memdoc">
<p>This function initializes the LIN library and must be called before any other LIN function is called. If this function isn't called, subsequent calls to the other LIN functions will return <a class="el" href="group__lin__status__codes.html#gga7a5ecfd2846ddd76cd49fb4edec7fc14a6017f3da581933a8e0b5049c53f918c2">linERR_NOTINITIALIZED</a>.</p>
<dl class="section see"><dt>See also</dt><dd><a class="el" href="group___l_i_n.html#ga040336f8176a10cb9578b47c42baef6b">linOpenChannel()</a> </dd></dl>

</div>
</div>
<a id="ga8af35ecbb1aca56baed27990f3d43d4b"></a>
<h2 class="memtitle"><span class="permalink"><a href="#ga8af35ecbb1aca56baed27990f3d43d4b">&#9670;&nbsp;</a></span>linReadTimer()</h2>

<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">unsigned long linReadTimer </td>
          <td>(</td>
          <td class="paramtype"><a class="el" href="linlib_8h.html#a759b2696d97bd97008d8df007d9ac44a">LinHandle</a>&#160;</td>
          <td class="paramname"><em>h</em></td><td>)</td>
          <td></td>
        </tr>
      </table>
</div><div class="memdoc">
<p>Return the current timer value (used for timestamps)</p>
<dl class="section note"><dt>Note</dt><dd>For convenience, this call returns the timer value instead of passing it in a parameter. This means that if the call fails, it will still return a value (which then is the error code, type casted to a long unsigned integer - e.g. 0xFFFFFFF2 for <a class="el" href="group__lin__status__codes.html#gga7a5ecfd2846ddd76cd49fb4edec7fc14a508ceb5ecd7123dc0f77d8cba90705b3">linERR_INVHANDLE</a>.</dd></dl>
<dl class="params"><dt>Parameters</dt><dd>
  <table class="params">
    <tr><td class="paramdir">[in]</td><td class="paramname">h</td><td>A handle to an open LIN channel. </td></tr>
  </table>
  </dd>
</dl>
<dl class="section return"><dt>Returns</dt><dd>If the call succeeds, the present timer value is returned. </dd></dl>

</div>
</div>
<a id="ga3b6bd0017ef68891ac1843a5921f81da"></a>
<h2 class="memtitle"><span class="permalink"><a href="#ga3b6bd0017ef68891ac1843a5921f81da">&#9670;&nbsp;</a></span>linUnloadLibrary()</h2>

<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">void linUnloadLibrary </td>
          <td>(</td>
          <td class="paramtype">void&#160;</td>
          <td class="paramname"></td><td>)</td>
          <td></td>
        </tr>
      </table>
</div><div class="memdoc">
<p>This function de-initializes the LIN library. After this function is called /ref linInitializeLibrary must be called before any other LIN function is called. </p>

</div>
</div>
</div><!-- contents -->
</div><!-- doc-content -->
<!-- HTML footer for doxygen 1.8.13-->
<!-- start footer part -->
<div id="nav-path" class="navpath"><!-- id is needed for treeview function! -->
  <ul>
    <li class="footer"> (canlib 5.38) Tue Feb 15 2022</li>
  </ul>
</div>
</body>
</html>
